/*
Copyright (C) 2011 Ing. Marek Hubal

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#pragma once

// .....................................................................................................................
// Trieda IBitStream
// .....................................................................................................................
class IBitStream {
protected:
	BYTE FCurrentMask; // Aktualna maska
	INT32 FCurrentIndex; // Aktualny index
public:
	PBYTE Data; // Data
	INT32 Capacity; // Aktualna kapacita a pocet bajtov
protected:
	void __fastcall Reallocate(void); // Realokacia pamate
	void __fastcall _AddBIT(bool pValue); // Zaradenie bitu
	bool __fastcall _GetBIT(void); // Nacitanie bitu
public:
	IBitStream(void); // Konstruktor
	~IBitStream(void); // Destruktor
public:
	void __fastcall Clear(void); // Uvolnenie objektu z pamate
	void __fastcall Rewind(void); // Pretocenie streamu na zaciatok
public:
	void __fastcall AddBIT(bool pValue); // Zaradenie bitu
	void __fastcall AddBYTE(BYTE pValue); // Zaradenie UINT8
	void __fastcall AddWORD(UINT16 pValue); // Zaradenie UINT16
	void __fastcall AddDWORD(UINT32 pValue); // Zaradenie UINT32
	void __fastcall AddQWORD(UINT64 pValue); // Zaradenie UINT64
public:
	bool __fastcall GetBIT(void); // Nacitanie bitu
	BYTE __fastcall GetBYTE(void); // Nacitanie UINT8
	UINT16 __fastcall GetWORD(void); // Nacitanie UINT16
	UINT32 __fastcall GetDWORD(void); // Nacitanie UINT32
	UINT64 __fastcall GetQWORD(void); // Nacitanie UINT64
};
// .....................................................................................................................
